<template>
    <div>
        <fm-generate-form :data="jsonData" :remote="remoteFuncs" :value="editData" ref="generateForm">

        </fm-generate-form>
        <el-button type="primary" @click="handleSubmit">提交</el-button>
    </div>
</template>

<script>
    export default {
        data () {
            return {
                jsonData: {"list":[{"type":"grid","icon":"icon-grid-","columns":[{"span":12,"list":[{"type":"input","icon":"icon-input","options":{"width":"100%","defaultValue":"","required":false,"dataType":"string","pattern":"","placeholder":"","disabled":false,"remoteFunc":"func_1587707542000_22859"},"name":"单行文本","key":"1587707542000_22859","model":"input_1587707542000_22859","rules":[{"type":"string","message":"单行文本格式不正确"}]}]},{"span":12,"list":[{"type":"input","icon":"icon-input","options":{"width":"100%","defaultValue":"","required":false,"dataType":"string","pattern":"","placeholder":"","disabled":false,"remoteFunc":"func_1587707547000_16309"},"name":"单行文本","key":"1587707547000_16309","model":"input_1587707547000_16309","rules":[{"type":"string","message":"单行文本格式不正确"}]}]},{"span":12,"list":[{"type":"time","icon":"icon-time","options":{"defaultValue":"","readonly":false,"disabled":false,"editable":true,"clearable":true,"placeholder":"","startPlaceholder":"","endPlaceholder":"","isRange":false,"arrowControl":true,"format":"HH:mm:ss","required":false,"width":"100%","remoteFunc":"func_1587712740000_75983"},"name":"时间选择器","key":"1587712740000_75983","model":"time_1587712740000_75983","rules":[]}]}],"options":{"gutter":1,"justify":"start","align":"top","remoteFunc":"func_1587707504000_34528"},"name":"栅格布局","key":"1587707504000_34528","model":"grid_1587707504000_34528","rules":[]}],"config":{"labelWidth":100,"labelPosition":"right","size":"mini"}},
                editData: {},
                remoteFuncs: {

                }
            }
        },
        methods: {
            handleSubmit () {
                this.$refs.generateForm.getData().then(data => {
                    data.toString()
                    // data check success
                    // data - form data
                }).catch(e => {
                    e.message
                    // data check failed
                })
            }
        }
    }
</script>

<style scoped>

</style>
